[tool.ruff]
target-version = 'py310'
select = [
    "B",  # flake8-bugbear
    "C4", # flake8-comprehensions
    "D",  # pydocstyle
    "E",  # Error
    "F",  # pyflakes
    "I",  # isort
    "ISC", # flake8-implicit-str-concat
    "N",  # pep8-naming
    "PGH",  # pygrep-hooks
    "PTH", # flake8-use-pathlib
    "Q",  # flake8-quotes
    "S",  # bandit
    "SIM",  # flake8-simplify
    "TRY",  # tryceratops
    "UP",  # pyupgrade
    "W",  # Warning
    "YTT", # flake8-2020
]

exclude = [
    "migrations",
    "data",
    "frontend",
    "img",
    "__pycache__",
    "manage.py",
    "settings.py",
    "env",
    ".env",
    "venv",
    ".venv",
    "tests",
]

ignore = [
    "D100",
    "D101",
    "D102",
    "D103",
    "D104",
    "D105",
    "D106",
    "D107",
    "D200",
    "D401",
    "E402",
    "E501",
    "F401",
    "D205",
    "TRY002",
    "TRY003",
    "E722",
    "N999",
    "TRY300",
    "TRY302",
    "D205",
    "N805",
    "B007",
    "B904",
    "TRY200",
    "B023",
    "E721",
    "N803",
    "N806",
    "S113",
    "B905",
    "PTH123",
    "PTH207",
    "SIM115",
    "SIM102",
    "PTH110",
    "N815",
    "PTH118",
    "PTH113",
    "S104",
    "PTH107"]

line-length = 120  # Must agree with Black

[tool.ruff.flake8-bugbear]
extend-immutable-calls = [
    "chr",
    "typer.Argument",
    "typer.Option",
]

[tool.ruff.pydocstyle]
convention = "numpy"

[tool.ruff.per-file-ignores]
"tests/*.py" = [
    "D100",
    "D101",
    "D102",
    "D103",
    "D104",
    "D105",
    "D106",
    "D107",
    "S101",  # use of "assert"
    "S102",  # use of "exec"
    "S106",  # possible hardcoded password.
    "PGH001",  # use of "eval"
]

[tool.ruff.pep8-naming]
staticmethod-decorators = [
    "pydantic.validator",
    "pydantic.root_validator",
]


[tool.ruff.isort]
section-order = ["fastapi", "future", "standard-library", "third-party",  "first-party", "local-folder"]

[tool.ruff.isort.sections]
fastapi = ["fastapi"]


[tool.pytest.ini_options]
pythonpath = ["."]
